<!DOCTYPE html>
<html>
  <head>
    <title>New Sails App</title>

    <!-- Viewport mobile tag for sensible mobile support -->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    
    <!--  
        Stylesheets and Preprocessors
        ==============================

        You can always bring in CSS files manually with `<link>` tags, or asynchronously
        using a solution like AMD (RequireJS).  Or, if you like, you can take advantage 
        of Sails' conventional asset pipeline (boilerplate Gruntfile).

        By default, stylesheets from your `assets/styles` folder are included
        here automatically (between STYLES and STYLES END). Both CSS (.css) and LESS (.less)
        are supported. In production, your styles will be minified and concatenated into
        a single file.
        
        To customize any part of the built-in behavior, just edit `tasks/pipeline.js`.
        For example, here are a few things you could do:
            
            + Change the order of your CSS files
            + Import stylesheets from other directories
            + Use a different or additional preprocessor, like SASS, SCSS or Stylus
    -->

    <!--STYLES-->
    <link rel="stylesheet" href="/styles/bootstrap.min.css">
    <link rel="stylesheet" href="/styles/custom.css">
    <link rel="stylesheet" href="/styles/importer.css">
    <!--STYLES END-->
  </head>

  <body>
    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a href="/" class="navbar-brand">Proyect CAF 2015</a>            
        </div>
        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
            <% if (session.authenticated) { %>
            <li class="active"><a href="/user/show/<%= session.User.id %>"><%= session.User.name %></a></li>
            <% } %>
            <% if (session.authenticated && session.User.admin) { %>
            <li><a href="/user">User adminstration</a></li>
            <li><a href="#">Placeholder2</a></li>
            <% } %>
          </ul>
          <div class="navbar-right">
            <% if (session.authenticated) { %>
              <a href="/session/destroy" class="btn btn-default navbar-btn navbar-right">Signout</a>
            <% } %>
          </div>
          <% if (!session.authenticated) { %>
            <form action="/session/create" class="navbar-form  navbar-right ">
              <div class="form-group">
                <input type="text" placeholder="usuario" name="username" class="form-control">
              </div>
              <div class="form-group">
                <input type="password" placeholder="Contraseña" name="password" class="form-control">
              </div>
              <button type="submit" class="btn btn-success">Sign in</button>
              <input type="hidden" name="_csrf" value="<%= _csrf %>">
            </form>
          <% } %>
        </div>
      </div>
    </div>

    <%- body %>

    <div class="container">
      <hr>
      <footer class="footer pull-right">
        <div>
          <a href="http://www.caf.es/">CAF</a>
          <div>Gracias por utilizar nuestra aplicación</div>
        </div>
      </footer>
    </div>



    <!--
        Client-side Templates
        ========================

        HTML templates are important prerequisites of modern, rich client applications.
        To work their magic, frameworks like Backbone, Angular, Ember, and Knockout require
        that you load these templates client-side.

        By default, your Gruntfile is configured to automatically load and precompile
        client-side JST templates in your `assets/templates` folder, then
        include them here automatically (between TEMPLATES and TEMPLATES END).
        
        To customize this behavior to fit your needs, just edit `tasks/pipeline.js`.
        For example, here are a few things you could do:

            + Import templates from other directories
            + Use a different template engine (handlebars, jade, dust, etc.)
            + Internationalize your client-side templates using a server-side
              stringfile before they're served.
    -->

    <!--TEMPLATES-->
    
    <!--TEMPLATES END-->


    <!--

      Client-side Javascript
      ========================

      You can always bring in JS files manually with `script` tags, or asynchronously
      on the client using a solution like AMD (RequireJS).  Or, if you like, you can 
      take advantage of Sails' conventional asset pipeline (boilerplate Gruntfile).

      By default, files in your `assets/js` folder are included here
      automatically (between SCRIPTS and SCRIPTS END).  Both JavaScript (.js) and
      CoffeeScript (.coffee) are supported. In production, your scripts will be minified
      and concatenated into a single file.
      
      To customize any part of the built-in behavior, just edit `tasks/pipeline.js`.
      For example, here are a few things you could do:
          
          + Change the order of your scripts
          + Import scripts from other directories
          + Use a different preprocessor, like TypeScript

    -->

    <!--SCRIPTS-->
    <script src="/js/dependencies/sails.io.js"></script>
    <script src="/js/dependencies/jquery-1.11.3.min.js"></script>
    <script src="/js/dependencies/jquery.validate.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script src="/js/customValidate.js"></script>
    <script src="/js/npm.js"></script>
    <!--SCRIPTS END-->
  </body>
</html>
